1. Field of Invention
The invention relates to a data transmission device and the method thereof. In particular, the invention relates to a device that uses parameters to provide multi-channel serial data transmissions and the method thereof.
2. Related Art
A serial device is a device that has a serial port and can exchange data with other devices (usually a computer). Generally speaking, the serial port commonly used by the personal computer (PC) is RS-232. The serial ports commonly used by the industrial computer are half-duplex RS-485 and full-duplex RS-422. The serial device and other devices use physical lines as the media for transmitting data. Under normal conditions, the physical line is a serial circuit, with one end connected to the serial port on the serial device and the other end connected to the serial port of the other device.
Current device server connects to the serial device via a serial port too. The data received by the serial port is sent to the network end. It also sends the data from the network end to the serial port. Thus, the serial device and the network can exchange data. Generally speaking, the device server can provide different operation modes, such as TCP server, TCP client, etc, using its various serial ports, according to different ways of connecting the serial device to the network. The serial device can opt one of the operation modes according to the needs.
Currently, if the device server has to use different operation modes simultaneously, it can select its various serial ports to achieve it, provided there are several serial ports thereon. However, existing embedded device server usually has only one serial port. When the serial device connected to the embedded device server needs to use different operation modes for data transmissions, the embedded device server has to close the current connection or operation mode first and then it could establish new connection or operation mode. This is how it switches among different operation modes for the connected serial devices. However, such a mechanism takes some extra time for initializing the operation mode. It is therefore very inconvenient and inefficient.
In summary, the prior art always has the problem that when serial devices of different operation modes use a single serial port to communicate with other serial devices, the two serial devices have to waste time on switching between the two operation modes. It is therefore more desirable to provide a better solution.